#!/bin/bash
# build-and-run.sh

# 获取宿主机 UID/GID
HOST_UID=$(id -u)
HOST_GID=$(id -g)

# 构建镜像
docker build \
  --build-arg HOST_UID=$HOST_UID \
  --build-arg HOST_GID=$HOST_GID \
  -t my-ssh-dev .

echo "Docker image 'my-ssh-dev' built successfully."

# 运行容器
docker run -it --rm \
  -v $HOME/.ssh:/home/shawn/.ssh:ro \
  -v $(pwd):/home/shawn/work \
  my-ssh-dev


# docker run -it --rm -v "${PWD}:/home/shawn/work" my-ssh-dev /bin/bash

# docker build --build-arg HOST_UID=1000 --build-arg HOST_GID=1000 -t my-ssh-dev .

